Class: RPM::File
- Inherits:
-
Object
- Object
- RPM::File
- Defined in:
- ext/rpm/file.c
Instance Method Summary (collapse)
- - (Object) attr
-
- (Boolean) config?
True if the file is marked as a configuration file.
-
- (Boolean) doc?
True if the file is marked as documentation.
-
- (Boolean) donotuse?
True if the file is marked as do not use.
-
- (Boolean) exclude?
True if the file is listed in the exlude section.
-
- (Boolean) ghost?
This flag indicates the file should not be included in the package.
-
- (String) group
Group that owns the file.
- - (Object) initialize constructor
-
- (Boolean) license?
True if the file is a license.
-
- (String) link_to
Path to the destination if the file is a symbolic link.
-
- (String) md5sum
Md5sum as string.
-
- (Boolean) missingok?
This modifier is used for files or links that are created during the %post scripts.
-
- (Number) mode
File permissions.
-
- (Time) mtime
File modification time.
-
- (Boolean) netshared?
True if the file is shared over the network.
-
- (Boolean) noreplace?
This flag is used to protect local modifications.
-
- (Boolean) notinstalled?
True if the file is not installed.
-
- (String) owner
File owner.
-
- (String) path
File path.
-
- (Number) rdev
Device type of the file.
-
- (Boolean) readme?
True if the file is a README.
-
- (Boolean) replaced?
True if the file is replaced during installation.
-
- (Number) size
File size.
-
- (Boolean) specfile?
True if the file is marked as a spec file.
- - (Object) state
-
- (Boolean) symlink?
True if the file is a symbolic link.
Constructor Details
- (Object) initialize
Instance Method Details
- (Object) attr
- (Boolean) config?
True if the file is marked as a configuration file
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_config(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_CONFIG) ? Qtrue : Qfalse;
}
|
- (Boolean) doc?
True if the file is marked as documentation
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_doc(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_DOC) ? Qtrue : Qfalse;
}
|
- (Boolean) donotuse?
True if the file is marked as do not use
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_donotuse(VALUE file)
{
#if RPM_VERSION_CODE < RPM_VERSION(4,1,0)
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_DONOTUSE) ? Qtrue : Qfalse;
#else
return Qfalse;
#endif
}
|
- (Boolean) exclude?
True if the file is listed in the exlude section
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_exclude(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_EXCLUDE) ? Qtrue : Qfalse;
}
|
- (Boolean) ghost?
This flag indicates the file should not be included in the package. It can be used to name the needed attributes for a file that the program, when installed,
will create.
For example, you may want to ensure that a program???s log file has certain attributes.
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_ghost(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_GHOST) ? Qtrue : Qfalse;
}
|
- (String) group
Group that owns the file. Nil may be returned.
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_group(VALUE file)
{
return rb_ivar_get(file, id_group);
}
|
- (Boolean) license?
True if the file is a license
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_license(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_LICENSE) ? Qtrue : Qfalse;
}
|
- (String) link_to
This path is sometimes relative. To convert an absolute path from relative path: File.expand_path (file.link_to, File.dirname (file.path))
Path to the destination if the file is a symbolic link
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_link_to(VALUE file)
{
return rb_ivar_get(file, id_link_to);
}
|
- (String) md5sum
Md5sum as string
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_md5sum(VALUE file)
{
return rb_ivar_get(file, id_md5sum);
}
|
- (Boolean) missingok?
This modifier is used for files or links that are created during the %post scripts
but will need to be removed if the package is removed
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_missingok(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_MISSINGOK) ? Qtrue : Qfalse;
}
|
- (Number) mode
File permissions
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_mode(VALUE file)
{
return rb_ivar_get(file, id_mode);
}
|
- (Time) mtime
File modification time.
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_mtime(VALUE file)
{
return rb_ivar_get(file, id_mtime);
}
|
True if the file is shared over the network
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_netshared(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_state))
== RPMFILE_STATE_NETSHARED) ? Qtrue : Qfalse;
}
|
- (Boolean) noreplace?
This flag is used to protect local modifications. If used, the file will not overwrite an existing file that has been modified. If the file has not been modified on disk, the rpm command will overwrite the file. But,
if the file has been modified on disk, the rpm command will copy the new file with an extra file-name extension of .rpmnew.
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_noreplace(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_NOREPLACE) ? Qtrue : Qfalse;
}
|
- (Boolean) notinstalled?
True if the file is not installed
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_notinstalled(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_state))
== RPMFILE_STATE_NOTINSTALLED) ? Qtrue : Qfalse;
}
|
- (String) owner
File owner. Nil may be returned.
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_owner(VALUE file)
{
return rb_ivar_get(file, id_owner);
}
|
- (String) path
File path
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_path(VALUE file)
{
return rb_ivar_get(file, id_path);
}
|
- (Number) rdev
Device type of the file
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_rdev(VALUE file)
{
return rb_ivar_get(file, id_rdev);
}
|
- (Boolean) readme?
True if the file is a README
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_readme(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_README) ? Qtrue : Qfalse;
}
|
- (Boolean) replaced?
True if the file is replaced during installation
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_replaced(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_state))
== RPMFILE_STATE_REPLACED) ? Qtrue : Qfalse;
}
|
- (Number) size
File size
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_get_size(VALUE file)
{
return rb_ivar_get(file, id_size);
}
|
- (Boolean) specfile?
True if the file is marked as a spec file
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_specfile(VALUE file)
{
return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_SPECFILE) ? Qtrue : Qfalse;
}
|
- (Object) state
- (Boolean) symlink?
True if the file is a symbolic link
|
# File 'ext/rpm/file.c'
VALUE
rpm_file_is_symlink(VALUE file)
{
return NIL_P(rb_ivar_get(file, id_link_to)) ? Qfalse : Qtrue;
}
|